<%@ page language="java" contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript">

/* 


WLControl.urlGo(1, function(goUrl){
	window.location.href = goUrl
});



 */

//外链控制
var WLControl = {
		
		//DEBUG : false,
		
		wl_control_switch_sysconfig_key : 'control_link_ab', //系统表中查询 外链屏蔽开关 的键key
		
		selectWLContentAvaliable : function(relativePathPrefixx,wlContentJson,callback){
			var url=relativePathPrefixx+'externalLink/selectWLContentAvaliable.do?f_wlc_id=' + wlContentJson.f_wlc_id + '&sysConfigKey=' + wlContentJson.sysConfigKey;
			var ajax = new AJAX_OBJ(url, callback);
			return ajax.requestData();
		},
		getRelativePathPrefix : function() {
			var current_url = window.location.href;
			var arrurl = current_url.split("//");
			var arrurl_category = arrurl[1];
			if(arrurl_category.indexOf("?")!=-1){
				arrurl_category=arrurl_category.substring(0,arrurl_category.indexOf("?"));
			}
			arrurl_category = arrurl_category.split("/");
			var relativePathPrefixCount = arrurl_category.length - 3;
			var relativePathPrefixx = '';
			for(var i = 0; i < relativePathPrefixCount; i ++) {
				relativePathPrefixx += '../';
			}
			return relativePathPrefixx;
		},
		
		//外链跳转方法
		urlGo : function(f_wlc_id, callback) {
			this.selectWLContentAvaliable(this.getRelativePathPrefix(), {f_wlc_id : f_wlc_id, sysConfigKey : this.wl_control_switch_sysconfig_key}, function(__xmlhttp){
				if(__xmlhttp.responseText) {
                    var json;
                    json = Josncheck(__xmlhttp.responseText);
					if(json && json.f_wlc_path) {
						callback(json.f_wlc_path);
					}
				}
			});
		}
};

</script>